﻿/* Update Zone */
function ClientViewFeedBack(fbid) {
    Url = Portal.SODC.WebSite.SuggestWP.GetViewFeedBackUrl(fbid).value;
    if(Url.indexOf("ERROR")!=-1)
    {
        alert(Url);
        return;
    }
    
    window.showModalDialog(Url, null, 'dialogHeight: 600px; dialogWidth: 800px; dialogTop: 10px; dialogLeft: 150px; edge: Raised; center: Yes; help: No; scroll: Yes; status: Yes;'); 
    ClientRefreshListFeedBack();
}

function ClientUpdateFeedBack()
{
    retValue = SharepointPortal.WebParts.FeedBacks.FeedBack.ServerSideDeletetCustomer(coid).value;
    if(retValue.indexOf("ERROR")!=-1)
    {
        alert(retValue);
        return;
    }
    alert(retValue);
    ClientRefreshListFeedBack();
}

/* READ Zone */
function ClientRefreshListFeedBack()
{
    divFBList = document.getElementById('FeedBackList');
    divFBList.innerHTML = Portal.SODC.WebSite.SuggestWP.RenderListContact().value;
}

/* DELETE Zone */
function ClientDeleteFeedBack(fbid) {
    Msg = Portal.SODC.WebSite.SuggestWP.GetConfirmDeleteMsg().value;
    if (confirm(Msg) == false) return;
    retValue = Portal.SODC.WebSite.SuggestWP.ServerSideDeletetFeedBack(fbid).value;
    if(retValue.indexOf("ERROR")!=-1)
    {
        alert(retValue);
        return;
    }
    alert(retValue);
    ClientRefreshListFeedBack();
}

function ClientDeleteFeedBackFromDetail(fbid) {
    Msg = Portal.SODC.WebSite.SuggestWP.GetConfirmDeleteMsg().value;
    if (confirm(Msg) == false) return;
    retValue = Portal.SODC.WebSite.SuggestWP.ServerSideDeletetFeedBack(fbid).value;
    if(retValue.indexOf("ERROR")!=-1)
    {
        alert(retValue);
        return;
    }
    alert(retValue);
    window.close();
    ClientRefreshListFeedBack();
}